<template>
	<view>
		<view v-for="(item,index) in stepLists" :key="index">
			<view style="display: flex;width: 100%;margin-top: 30rpx;">
				<view style="width: 60%;display: flex;">
					<view class="circle_dian2" style="color: #999;line-height: 20px;">·</view>
					<view class="cardTitle2" v-if="item.step==0" @click="changeStock(item,index)">
						{{text.Stock}}
						<text class="jiantou2" v-if="item.status==1">></text>
						<text class="jiantou2" v-if="item.status==2">∨</text>
					</view>
					<view class="cardTitle2" style="text-align: left;" v-if="item.step!=0" @click="changeStock(item,index)">
						{{text.Stock2}}{{item.step}}%
						<text class="jiantou2" v-if="item.status==1">></text>
						<text class="jiantou2" v-if="item.status==2">∨</text>
					</view>
				</view>
				<view style="width: 40%;font-size: 12px;line-height: 28px;text-align: right;">
					{{item.createtime}}
				</view>
			</view>
			<view class="stock_text" v-if="item.status==2&&item.text!=''&&lang=='zh'">
				<view>
					<image :src="item.images" class="nav_image" @click.stop="preview(item.images,stepLists,index)"></image>
				</view>
				<view>{{item.location}}</view>
			</view>
			<view class="stock_text" v-else-if="item.status==2&&item.text!=''&&lang=='ru'">
				<view>
					<image :src="item.images" class="nav_image" @click.stop="preview(item.images,stepLists,index)"></image>
				</view>
				<view>{{item.location_ru}}</view>
			</view>
		</view>
		<view style="display: none;">{{leixing}}</view>
	</view>
</template>

<script>
	import {
		HTTP_REQUEST_URL,
		HTTP_IMG_UTL,
		IMAGE_URL
	} from "@/config/app";
	export default {
		props: {
			text: {
				type: [Array,Object,null],
				default: () => ({})
			},
			stepList: {
				type: [Array,Object,null],
				default: () => ({})
			},
			leixing: {
				type: [Number, String,null],
				default: ''
			},
		},
		data() {
			return {
				HTTP_IMG_UTL,//语言
				lang: this.$i18n.locale,
				stepLists:[]
			}
		},
		mounted() {
			this.stepLists = this.stepList
		},
		methods: {
			// 预览图片
			preview(e,preImgs,index) {
				let images = []
				preImgs.forEach((item) => {
					images.push(item.images)
				})
				
				var plat = uni.getStorageSync('plat')
				if(plat=='app'){
					uni.previewImage({
						current: index,
						urls: images,
						longPressActions: true
					})
				}else{
					uni.previewImage({
						current: e,
						urls: images,
						longPressActions: true
					})
				}
				

			},
			//进度查看详情
			changeStock(item, index) {
				console.log(item,index)
				if (this.stepLists[index].status == 1) {
					this.stepLists[index].status = 2
				} else {
					this.stepLists[index].status = 1
				}
			},
		}
	}
</script>
<style lang="scss" scoped>
	@import "@/common/orderDetail.scss";
</style>